package com.sl.au.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.sl.au.entity.KitchenWaste;

public interface KitchenWasteRepository extends JpaRepository<KitchenWaste, String> {

	@Query("select kw from KitchenWaste kw where kw.businesssellerBaseInfo.id=?1")
	Page<KitchenWaste> getKitchenWasteByHistory(String key, Pageable pageable);
	
	@Query("select kw from KitchenWaste kw where kw.businesssellerBaseInfo.shopName like %?1% and kw.checkPerson.id =?2")
	Page<KitchenWaste> getKitchenWastes(String key, String userId, Pageable pageable);
	
	@Query("select kw from KitchenWaste kw where kw.checkPerson.id =?1")
	Page<KitchenWaste> getByUserId(String id, Pageable pageable);
}
